-
Notifications
You must be signed in to change notification settings - Fork 18
Fixed up for release. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adafruit_button.py
Outdated
@@ -38,21 +38,50 @@ | |||
|
|||
""" | |||
|
|||
from micropython import const | |||
import displayio | |||
from adafruit_display_text.text_area import TextArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adafruit_display_text should refer to Label, instead of TextArea (https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/releases/tag/2.0.0)
adafruit_button.py
Outdated
Defaults to RECT. | ||
:param fill_color: The color to fill the button. Defaults to 0xFFFFFF. | ||
:param outline_color: The color of the outline of the button. | ||
:param label: The button label. Defaults to 0x0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label is the button text that appears inside it, by default nothing is displayed
adafruit_button.py
Outdated
if self.shadow: | ||
self.group.append(self.shadow) | ||
self.group.append(self.body) | ||
|
||
if label and (label_color is not None): # button with text label | ||
if label and (label_color is not None): # button with text label | ||
if not label_font: | ||
raise RuntimeError("Please provide label font") | ||
dims = label_font.text_bounding_box(label) | ||
if dims[2] >= width or dims[3] >= height: | ||
raise RuntimeError("Button not large enough for label") | ||
self.label = TextArea(label_font, text=label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Label not TextArea, too
No description provided.